import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'views',
      redirect: { name: 'LifeCircle' },
      component: () => import('@/Views/index.vue'),
      children: [
        {
          path: 'life-circle',
          name: 'LifeCircle',
          component: () => import('@/views/LifeCircle/index.vue'),
        },
        {
          path: 'event-loop',
          name: 'EventLoop',
          component: () => import('@/views/EventLoop/index.vue'),
        },
        {
          path: 'parameter-pass',
          name: 'ParameterPass',
          component: () => import('@/views/ParameterPass/index.vue'),
        },
        {
          path: 'use-hook',
          name: 'UseHook',
          component: () => import('@/views/UseHook/index.vue'),
        },
        {
          path: 'css',
          name: 'Css',
          component: () => import('@/views/Css/index.vue'),
        },
      ],
    },
  ],
})

export default router
